home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Peter's Final Project / src / maze.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  1.9 KB  |  54 lines  |  [TEXT/KAHL]

  1. /*
  2.  *  Peter's Final Project -- A texture mapping demonstration
  3.  *  © 1995, Peter Mattis
  4.  *
  5.  *  E-mail:
  6.  *  petm@soda.csua.berkeley.edu
  7.  *
  8.  *  Snail-mail:
  9.  *   Peter Mattis
  10.  *   557 Fort Laramie Dr.
  11.  *   Sunnyvale, CA 94087
  12.  *
  13.  *  Avaible from:
  14.  *  http://www.csua.berkeley.edu/~petm/final.html
  15.  *
  16.  *  This program is free software; you can redistribute it and/or modify
  17.  *  it under the terms of the GNU General Public License as published by
  18.  *  the Free Software Foundation; either version 2 of the License, or
  19.  *  (at your option) any later version.
  20.  *
  21.  *  This program is distributed in the hope that it will be useful,
  22.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  *  GNU General Public License for more details.
  25.  *
  26.  *  You should have received a copy of the GNU General Public License
  27.  *  along with this program; if not, write to the Free Software
  28.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  */
  30.  
  31. #ifndef __MAZE_H__
  32. #define __MAZE_H__
  33.  
  34. #include "type.defs.h"
  35.  
  36. MAZE make_maze (void);
  37. void free_maze (MAZE);
  38.  
  39. void maze_init (MAZE, short, long);
  40. void maze_describe (MAZE);
  41.  
  42. #define maze_size(m)                  ((m)->size)
  43. #define maze_element(m, row, col)         (*((m)->data + (row) * maze_size(m) + (col)))
  44. #define maze_element_state(m, row, col)   (maze_element(m, row, col).state)
  45. #define maze_element_id(m, row, col)      (maze_element(m, row, col).id)
  46. #define maze_element_sector(m, row, col)  (maze_element(m, row, col).sector)
  47.  
  48. #define set_maze_element(m, row, col, k)         (maze_element(m, row, col) = (k))
  49. #define set_maze_element_state(m, row, col, k)   (maze_element_state(m, row, col) = (k))
  50. #define set_maze_element_id(m, row, col, k)      (maze_element_id(m, row, col) = (k))
  51. #define set_maze_element_sector(m, row, col, k)  (maze_element_sector(m, row, col) = (k))
  52.  
  53. #endif /* __MAZE_H__ */
  54.